<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>{$site.name}</title>

    <!-- Bootstrap Core CSS -->
    <link href="__CDN__/assets/libs/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="__CDN__/assets/css/index.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="__CDN__/assets/js/html5shiv.js"></script>
    <script src="__CDN__/assets/js/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        body {
            font-family: "Microsoft Yahei";
            color: #fff;
            background-color: #333333;
        }
        .wx-dialog {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }
        .wx-dialog .wx-hd {
            font-size: 20px;
            margin: 20px 0;
        }
        .wx-dialog .wx-qrcode {
            width: 250px;
            height: 250px;
            border: 1px solid #e0e1e5;
        }
        .wx-dialog .wx-qrcode-img {
            width: 100%;
            height: 100%;

        }
        .wx-dialog .wx-ft {
            font-size: 14px;
            margin: 20px 0;
            padding: 15px;
            background-color: #232323;
            border-radius: 100px;
            -moz-border-radius: 100px;
            -webkit-border-radius: 100px;
            box-shadow: inset 0 5px 10px -5px #191919, 0 1px 0 0 #444;
            -moz-box-shadow: inset 0 5px 10px -5px #191919, 0 1px 0 0 #444;
            -webkit-box-shadow: inset 0 5px 10px -5px #191919, 0 1px 0 0 #444;
        }
        .wx-dialog .wx-ft.expire {
            display: none;
        }
        .wx-dialog .wx-ft.expire .refresh {
            margin-left: 5px;
            cursor: pointer;
            text-decoration: underline;
        }
        .wx-dialog .wx-ft.error {
            display: none;
        }

    </style>
</head>

<body id="page-top">


<header>
    <div class="container">
        <div class="row">
            <div class="">
                <div class="">
                    <div class="wx-dialog">
                        <div class="wx-hd">微信登录</div>
                        <h1 class="wx-qrcode"><img src="{$ticket_img}"  class="wx-qrcode-img"></h1>
                        {if condition="$mpType == 'auth'"}
                        <div class="wx-ft info" style="
    background-color: #232323;
">扫码--》关注公众号--》自动登录</div>
                        {else}
                        <div class="wx-ft info" style="
    background-color: #232323;
">扫码--》关注公众号--》回复</div>
                        <div>回复“ <span style="font-size: 16px;color:#f00;font-weight: bold">{$scene_id}</span> ”登录，60秒内有效 </div>
                        {/if}

                    </div>
                </div>
            </div>
        </div>
    </div>
</header>

<script src="__CDN__/assets/libs/jquery/dist/jquery.min.js"></script>
<script src="__CDN__/assets/libs/bootstrap/dist/js/bootstrap.min.js"></script>

</body>
<script type="text/javascript">
    check_login();

    function check_login() {
        var url = "{:addon_url('wxfollowlogin/index/scan')}";
        $.post(url, {scene_id: '{$scene_id}'}, function (response) {

            var data = response.data;

            if (data.openid != "") {
                {if condition="$url"}
                    //window.location.href = "{$url}";
                    parent.window.location.href="{:url('user/index')}";
                {else:}
                //window.location.href = "/"
                    parent.window.location.href="{:url('user/index')}";
                {/if}

                } else {
                    setTimeout("check_login()", 2000);
                }
            }, "json");
        }
</script>

</html>
